package nc.tb.excel.ctl;

import nc.tb.pub.util.NtbLogger;

public class ExcelOperatorFactory {
	public static final int OPERATE_BY_POI = 1;
	public static final int OPERATE_BY_JXL = 2;
	public static final int MODE_READ_ONLY = 0;
	public static final int MODE_WRITE = 1;
public static IExcelOperate getExcelOperator(int nType){
	if(nType == OPERATE_BY_POI)
		return new POIExcelOperator();
	else if(nType == OPERATE_BY_JXL){
		try {
			Class c = Class.forName("nc.tb.excel.ctl.JXLExcelOperator");
			return (IExcelOperate)c.newInstance();
		} catch (Exception e) {
			NtbLogger.error(e);
		}
	}
	return null;
}
}
